<style lang="scss" scoped>
	.content {
		width: 100%;
		background-color: white;

		padding: 30rpx 25rpx;
	}

	.list {

		border-bottom: 1px solid #ccc;
		align-items: flex-start;
		padding: 25rpx 0;

		.red {
			transform: translateY(6rpx);
		}

		.textarea {
			width: 550rpx;
			height: 120rpx;
			font-size: 28rpx;
		}

		.mic {
			height: 120rpx;
			width: 80rpx;
			border-left: 1px solid #ccc;
			padding-left: 20rpx;
		}

		.ipt,
		.picker {
			width: 550rpx;
			text-align: right;
		}

		.uploadfile {
			width: 550rpx;

			.btns {
				width: 100%;
				justify-content: flex-end;

				.btn {
					padding: 0 30rpx;
					height: 64rpx;
					opacity: 1;
					background: #fffefe;
					border: 2rpx solid #409eff;
					border-radius: 34rpx;
				}
			}
		}

		.record {
			width: 550rpx;
		}
	}

	.line2 {
		width: 100%;
		border-bottom: 1px solid #ccc;
		line-height: 80rpx;

		.line {
			width: 100%;

			.t2 {
				width: 60%;
			}
		}
	}

	.footer {
		height: 160rpx;

		background-color: white;

	}
</style>

<template>
	<view class="content">
		<view class="f34 bold border-bottom" style="padding:0 30rpx;padding-bottom: 20rpx;">终止</view>

		<evan-form ref="form" :model="formData">
			<evan-form-item label="终止原因" prop="processValue">
				<ItemRow v-model="formData.processValue" dicKey="demandTerminationReason"></ItemRow>
			</evan-form-item>
			<evan-form-item label="终止说明">
				<u-input type="textarea" v-model="formData.remark" input-align="right" placeholder="终止说明"></u-input>

			</evan-form-item>
		</evan-form>


		<view class="footer center-flex">
			<view class="lbtn" @click="submit">
				提交
			</view>

		</view>
	</view>
</template>

<script>
	import ItemRow from '@/components/arrow/itemArrow.vue'
	import ProjectApi from '@/apis/project.js'
	export default {
		components: {
			ItemRow
		},
		props: {
			itemCode: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				formData: {
					processValue: '',
					remark: ''
				},
				rules: {
					processValue: [{ required: true, message: '请选择终止原因' }]
				},

			}
		},
		mounted() {
			this.$nextTick(() => {
				this.$refs.form.setRules(this.rules)
			})
		},
		methods: {
			submit() {
				this.$showloading()
				this.$refs.form.validate((valid) => {
					if (valid) {
						ProjectApi.Demand.End({
							itemCode: this.itemCode,
							...this.formData
						}).then((res) => {
							uni.hideLoading()
							if (res.code == 0) {
								this.$msg('操作成功')
								setTimeout(() => {
									uni.navigateBack({

									})
								}, 1000)

							} else {
								this.$msg(res.msg)
							}
						})
					} else {
						uni.hideLoading()
					}
				})


			},



		},
	}
</script>
